﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using NUnit.Framework;
using Seasar.Quill;
using Seasar.Quill.Attrs;
using Seasar.Windows.Attr;
using Seasar.Framework.Aop;
using Seasar.Framework.Aop.Interceptors;
using Mayfair.Core.Tests.Common.FormManager;
using Mayfair.Core.Common.FormManager;
using Mayfair.Core.Common.FormManager.FormAttr;

namespace Mayfair.Core.Tests.Common.FormManager
{
    public partial class MenuView : BaseView
    {

        public MenuView()
        {
            InitializeComponent();
        }

        public string Init()
        {
            return "You Got MenuView Instance.";
        }

        private void button1_Click(object sender, EventArgs e)
        {
            _manager.ShowNext();
        }
    }
}

/// <summary>
/// フォーム遷移管理インターフェース(兼用サンプル)
/// </summary>
[Implementation]
[Aspect(typeof(Mayfair.Core.Common.FormManager.FormInterceptor))]
public interface IFormManager
{
    // 参考URL(http://s2container.net.seasar.org/ja/s2windows-control.html#quill)

    /// <summary>
    /// メニュー画面を表示
    /// </summary>
    [Mayfair.Core.Common.FormManager.FormAttr.Form(typeof(MenuView),
        Mayfair.Core.Common.FormManager.FormAttr.FormModalType.Modeless, "Init")]
    void ShowMenu();

    /// <summary>
    /// 次画面表示
    /// </summary>
    [Mayfair.Core.Common.FormManager.FormAttr.Form(typeof(NextView),
        Mayfair.Core.Common.FormManager.FormAttr.FormModalType.Modeless, "Init")]
    object ShowNext();
}